<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>病例详情</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="email=no"/>
<meta name="format-detection" content="address=no"/>
<link href="__PUBLIC__/css/base.css" rel="stylesheet"/>
</head>
<body class="huibg">
<!---  头部开始  -->
<div class="top clearfix">
	<div class="icon_left"></div>
	<div class="icon_right"></div>
</div>
<!---  头部结束  -->
<div class="bl_info bl_info2 cssss">
	<div class="box_02">
		<div class="title_01">
			<span>医生信息</span>
			<i></i>
		</div>
		<div class="box_03 shou">
			<img src="{$headimg}" />
			<div class="text">
				<p>
					<span>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</span>
					<b class="name">{$userinfo.name}</b>
				</p>
				<p>
					<span>工作单位：</span>
					<b>{$userinfo.hospital}</b>
				</p>
				<p>
					<span>工作科室：</span>
					<b>{$userinfo.department}</b>
				</p>
				<p>
					<span>职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：</span>
					<b>{$userinfo.position}</b>
				</p>
				<p>
					<span>社会职务：</span>
					<b>{$userinfo.socialposition}</b>
				</p>
			</div>
		</div>
	</div>
	<div class="box_02">
		<div class="title_01">
			<span>病例</span>
			<span class="size">（{$record.major}）</span>
			<i></i>
		</div>
		<div class="text shou">
			<p>
				<span>患者性别：</span>
				<b>{$record.gender}</b>
			</p>
			<p>
				<span>年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄：</span>
				<b>{$age}</b>
			</p>
			<p>
				<span>主&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;诉：</span>
				<b>{$record.complain}</b>
			</p>
			<p>
				<span>病&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;史：</span>
				<b> {$record.history}</b>
			</p>
			<p>
				<span>口腔病史：</span>
				<b>{$record.oralhistory}</b>
			</p>
			<p>
				<span>家庭史和个人基本情况</span>
				<b>{$record.profile}</b>
			</p>
		</div>
	</div>
	<div class="box_02">
		<div class="title_01">
			<span>病情检查</span>
			<i></i>
		</div>
		<div class="text shou">
			<p>
				<span>检&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;查：</span>
				<b>{$record.normalcheck}</b>
			</p>
			<p>
				<span>特殊检查和辅助检查：</span>
				<b>{$record.specialcheck}</b>
			</p>			
		</div>
	</div>
	<div class="box_02">
		<div class="title_01">
			<span>诊断与治疗</span>
			<i></i>
		</div>
		<div class="text shou">
			<p>
				<span>诊&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;断：</span>
				<b>{$record.diagnostic}</b>
			</p>
			<p>
				<span>治疗计划和治疗：</span>
				<b>{$record.tp}</b>
			</p>
			<p class="img_big">
				<volist name="image" id="vo">
				<img src="{$vo.image}" />
				</volist>
			</p>
			<p>
				<span>复诊和维护治疗：</span>
				<b>{$record.rediagnosis}</b>
			</p>
			<p>
				<span>预&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;后：</span>
				<b>{$record.prognosis}</b>
			</p>			
		</div>
	</div>
	<div class="box_02">
		<div class="title_01">
			<span>需要讨论与问题</span>
			<i></i>
		</div>
		<div class="text shou">
			<p>{$record.discuss}
			</p>					
		</div>
	</div>
	<div class="box_02 bd0 ">
		<div class="title_01">
			<span>评论</span>
			<i></i>
		</div>
		<div class="tab_box shou">
			<table class="tab_01">
			</table>			
		</div>
	</div>
	<a class="more">获取更多</a>
	<div class="huibg">
		<p class="title3">恳请您的评论与点赞：</p>
		<textarea class="textarea1" name="discuss" placeholder="亲，我们邀请您也来写评论哦！来写吧~" cols="30" rows="10"></textarea>
		<p>
			<a class="dz <if condition="$praise eq 0">check</if>">
				<i onclick = "recpraise({$record.id});"></i>
				<span>{$record.praise}</span>
			</a>
			<a class="disscuss">发送评论</a>
		</p>
		<p><a class="back_top" href="javascript:scroll(0,0)">返回顶部<i></i></a></p>
	</div>
	<div class="bott2">
		<a class="yes" href="__URL__/yqzj/rec_id/{$record.id}">我还想付费邀请其他专家评论</a>
	</div>
</div>

<!---  图片点击放大开始  -->
<!-- <div class="picBox none">
	<div class="picBox_bg"></div>
	<div class="picBox_img">
		<i class="close2"></i>
		<img src="img/pic/img01.jpg" />
	</div>
</div> -->
<!---  图片点击放大结束  -->
</body>
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/comm.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
var recordid = {$record.id};
var url ='http://www.denbox.cn/DenboxWeb/wechat.php?s=/Index/bl_info/id/'+recordid;
// $(window).resize(function(){
//   window.location=url;
// });
var imgurls="http://www.denbox.cn/DenboxWeb/Public/img/base/icon.jpg";
var title='';
if(title==""){
	title="病历分享";
}
var shareDesc = '{$record.complain}';
wx.config({
    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
    appId: '{$appid}', // 必填，公众号的唯一标识
    timestamp: {$timestamp} , // 必填，生成签名的时间戳
    nonceStr: '{$nonceStr}', // 必填，生成签名的随机串
    signature: '{$signature}',// 必填，签名，见附录1
    	jsApiList: [
		'uploadImage',
		'chooseImage',
		'checkJsApi',
		'previewImage',
		'onMenuShareAppMessage',
        'onMenuShareTimeline',
        'onMenuShareQQ',
        'onMenuShareWeibo'
	] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
});

var image = [<volist name="image" id="vo">"http://www.denbox.cn/DenboxWeb/{$vo.image}",</volist>];

wx.ready(function(){
  	$(".img_big").click(function(){
  		wx.previewImage({
		    current: image[0], // 当前显示图片的http链接
		    urls: image // 需要预览的图片http链接列表
		});
  	});
  	// 2. 分享接口
  // 2.1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
    wx.onMenuShareAppMessage({
      title: title,
      desc: shareDesc,
      link: url,
      imgUrl: imgurls,
      trigger: function (res) {
      },
      success: function (res) {
      	$.post('__URL__/wxshare',{type:1,id:recordid},function(e){
      	})
      },
      cancel: function (res) {
      },
      fail: function (res) {
      }
    });
  // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
  //document.querySelector('#onMenuShareTimeline').onclick = function () {
    wx.onMenuShareTimeline({
      title: title,
      link: url,
      imgUrl: imgurls,
      trigger: function (res) {
      },
      success: function (res) {
      	$.post('__URL__/wxshare',{type:1,id:recordid},function(e){
      	})
      },
      cancel: function (res) {
      },
      fail: function (res) {
      }
    });

  // 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
    wx.onMenuShareQQ({
      title: title,
      desc: shareDesc,
      link: url,
      imgUrl: imgurls,
      trigger: function (res) {
      },
      complete: function (res) {
      },
      success: function (res) {
      	$.post('__URL__/wxshare',{type:1,id:recordid},function(e){
      	})
      },
      cancel: function (res) {
      },
      fail: function (res) {
      }
    });
  // 2.4 监听“分享到微博”按钮点击、自定义分享内容及分享结果接口
    wx.onMenuShareWeibo({
      title: title,
      desc: shareDesc,
      link: url,
      imgUrl: imgurls,
      trigger: function (res) {
      },
      complete: function (res) {
      },
      success: function (res) {
      	$.post('__URL__/wxshare',{type:1,id:recordid},function(e){
      	})
      },
      cancel: function (res) {
      },
      fail: function (res) {
      }
    });
});

wx.error(function(res){
	alert(res.errMsg);
});

//病例详情 图片放大
// $(".img_big img").click(function(){
// 	$(".picBox").removeClass("none");
// });
$(".disscuss").click(function(){
	var content = $.trim($("textarea[name='discuss']").val());
	if(!content){
		return;
	}else{
		$.post('__URL__/bl_info_discuss',{id:recordid,content:content},function(e){
			if(e.status==1){
				window.location.reload();
			}
			if(e.status==0){
				alert(e.msg);
				return;
			}
			if(e.status==2){
				alert(e.msg);
				window.location = '__URL__/person_info4_edit';
			}
		});
	}
});

function recpraise(id){
	$.post('__URL__/bl_info_praise',{id:id},function(e){
		if(e.status==1){
			$(".huibg .dz").addClass('check');
			var praise = $(".huibg .dz>span").html();
			praise = parseInt(praise)+1;
			$(".huibg .dz>span").html(praise);
		}else{
			alert(e.msg);
		}
	});
}

var pageIndex = 0,pageSize=5;
var new_element;
function getlist(){
	$.post('__URL__/bl_info_page',{id:recordid,pageIndex:pageIndex,pageSize:pageSize},function(e){
		// cashtype : 1普通评论2邀请中3已评论4退费中
		// headimg 为头像
		// name 姓名 
		// position 职称
		// hospital 医院
		// content 评论内容
		// distime 最后评论的时间	
		//display: 1显示
		if(null==e){
			$(".more").text('没有数据');
			return;
		}
		if(e.length<pageSize){
			$(".more").text('已经是最后一页');
		}
		for (var i = 0; i < e.length; i++) {
			if(e[i].cashtype==1){
				new_element='<tr>'+
					'<th>'+
						'<img src="'+e[i].headimg+'" />'+
					'</th>'+
					'<td colspan="2">'+
						'<p class="hl1">'+
							'<b>'+e[i].name1+'</b>'+							
							'<span class="time">'+e[i].distime+'</span>'+
						'</p>'+						
						'<p class="comment">'+e[i].content1+'</p>'+
					'</td>'+
				'</tr>';
			}else if(e[i].cashtype==3){
				new_element='<tr>'+
					'<th>'+
						'<img src="'+e[i].headimg+'" />'+
					'</th>'+
					'<td>'+
						'<p class="hl1">'+
							'<b>'+e[i].name1+'</b>'+
							'<span>付费邀请</span>'+							
						'</p>'+
						'<p>'+e[i].hospital+'</p>'+
						'<p>'+e[i].position+'</p>'+
					'</td>'+
					'<td>'+
						'<div class="invite">邀请中</div>'+
					'</td>'+
				'</tr>';
			}else if(e[i].cashtype==2){
				new_element='<tr>'+
					'<th>'+
						'<img src="'+e[i].headimg+'" />'+
					'</th>'+
					'<td colspan="2">'+
						'<p class="hl1">'+
							'<b>'+e[i].name1+'</b>'+
							'<span>付费邀请</span>'+							
							'<span class="time">'+e[i].distime+'</span>'+
						'</p>'+						
						'<p class="comment">'+e[i].content1+'</p>'+
					'</td>'+
				'</tr>';
			}else if(e[i].cashtype==4){
				new_element='<tr>'+
					'<th>'+
						'<img src="'+e[i].headimg+'" />'+
					'</th>'+
					'<td>'+
						'<p class="hl1">'+
							'<b>'+e[i].name1+'</b>'+
							'<span>付费邀请</span>'+							
						'</p>'+
						'<p>'+e[i].hospital+'</p>'+
						'<p>'+e[i].position+'</p>'+
					'</td>'+
					'<td>'+
						'<div class="refund">退费中</div>'+
					'</td>'+
				'</tr>';
			}
			$(".tab_01").append(new_element);
		};
		$.each(e,function(k,v){
		});
	});
	pageIndex++;
}
$(".more").on("click",function(){
	getlist();
});

getlist();

</script>
</html>